@extends('admin.master')
<script src="/js/admin/dealer.js"></script>
@section('title', '经销商管理')
	
@section('firstItem')
@parent
				<span class="linkBtn">经销商管理</span>
				<input class="a_indexbg" type="hidden" value="chargerecords" />
				<div class="exportBtn">导出<img src="/img/admin/exportLogo.png" /></div>
@stop
@section('searchList')
@parent		

<a class="queryBtn dealerQueryBtn">搜索</a>
<div>
	<input class="dealerBox" type="text" placeholder="请输入经销商" value="{{ $dealer }}" />
</div>
<dvi class="dateList">
	<input class="afterYear" type="text" placeholder="起始年" value="{{ $after_date->year or '' }}" />年
	<input class="afterMonth" type="text" placeholder="起始月" value="{{ $after_date->month or '' }}" />月
	<input class="afterDate" type="text" placeholder="起始日" value="{{ $after_date->day or '' }}" />日
	<span>至</span>
	<input class="beforeYear" type="text" placeholder="截止年" value="{{ $before_date->year or '' }}" />年
	<input class="beforeMonth" type="text" placeholder="截止月" value="{{ $before_date->month or '' }}" />月
	<input class="beforeDate" type="text" placeholder="截止日" value="{{ $before_date->day or '' }}" />日
</dvi>
@stop
@section('dataTables')
@parent
			<table class="rechargeNotes dataTables" cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<td>序号</td>
						<td>经销商</td>
						<td>设备编号</td>
						<td>用户名</td>
						<td>剩余流量</td>
						<td>购买金额</td>
						<td>购买流量数</td>
						<td>购买人</td>
						<td>后台充值人</td>
						<td>撤销流量数</td>
						<td>撤销操作人</td>
						<td>备注信息</td>
						<td>日期</td>
					</tr>
				</thead>
				<tbody>
					@for($i=0, $chargeRecordCount=count($charge_records); $i<$chargeRecordCount; $i++)
					<tr >
						<td>{{ $i+1 }}</td>
						<td>{{ $charge_records[$i]->device->installInfo->dealer or '' }}</td>
						<td class="devicecodeVal">{{ $charge_records[$i]->device->code }}</td>
						<td>{{ $charge_records[$i]->device->installInfo->customer_name or '' }}</td>
						<td>{{ $charge_records[$i]->residual_flow }}L</td>
						<td>{{ $charge_records[$i]->money or 0 }}元</td>
						<td>{{ $charge_records[$i]->flow }}L</td>
						<td>{{ $charge_records[$i]->userInfo->name or '' }}</td>
						<td>{{ $charge_records[$i]->adminInfo->name or '' }}</td>
						<td>{{ is_null($charge_records[$i]->discharge_flow)? '': $charge_records[$i]->discharge_flow.'L'}}</td>
						<td>{{ $charge_records[$i]->dischargeAdmin->name or '' }}</td>
						<td class="add_text" style="width:200px;">{{ $charge_records[$i]->remark or '' }}</td>
						<td>{{ $charge_records[$i]->created_at }}</td>
					</tr>
					@endfor
				</tbody>
			</table>
@stop
@section('page_num')
<ul class="pagination pagination-lg"> 
	@if(!is_null($charge_records->first()))
	{!! $charge_records->appends(['device_id' => $charge_records->first()->device_id])->render() !!}
	@endif
</ul>
@stop
@section('infor_promit')
@parent

@stop
